package cn.cs.mathgo.admin.modules.sys.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


@FeignClient(name="sc-admin",fallback = UserFeignClient.UserFeignClientImpl.class)
public interface UserFeignClient {

    @RequestMapping(method = RequestMethod.GET ,value = "/sys/user/getByName/{name}")
    R getByName(@PathVariable(value = "name") String name);

    @RequestMapping(method = RequestMethod.GET ,value = "/sys/user/info/{userId}")
    R getById(@PathVariable(value = "userId") Long userId);


    @Component
    class UserFeignClientImpl implements UserFeignClient {

        @Override
        public R getByName(String name) {
            return null;
        }

        @Override
        public R getById(Long id) {
            return null;
        }
    }
}
